home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH3 / SRC / RGBCOLOR.BAS < prev    next >
BASIC Source File  |  1997-01-03  |  1KB  |  24 lines

  1. Attribute VB_Name = "RGBColor"
  2. Option Explicit
  3.  
  4. Type PALETTEENTRY
  5.     peRed As Byte
  6.     peGreen As Byte
  7.     peBlue As Byte
  8.     peFlags As Byte
  9. End Type
  10. Global Const RASTERCAPS = 38    ' Raster device capabilities.
  11. Global Const RC_PALETTE = &H100 ' Has palettes.
  12.  
  13. #If Win32 Then
  14.     Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long
  15.     Declare Function ResizePalette Lib "gdi32" (ByVal hPalette As Long, ByVal nNumEntries As Long) As Long
  16.     Declare Function SetPaletteEntries Lib "gdi32" (ByVal hPalette As Long, ByVal wStartIndex As Long, ByVal wNumEntries As Long, lpPaletteEntries As PALETTEENTRY) As Long
  17.     Declare Function RealizePalette Lib "gdi32" (ByVal hdc As Long) As Long
  18. #Else
  19.     Declare Function GetDeviceCaps Lib "GDI" (ByVal hdc As Integer, ByVal nIndex As Integer) As Integer
  20.     Declare Function ResizePalette Lib "GDI" (ByVal hPalette As Integer, ByVal nNumEntries As Integer) As Integer
  21.     Declare Function SetPaletteEntries Lib "GDI" (ByVal hPalette As Integer, ByVal wStartIndex As Integer, ByVal wNumEntries As Integer, lpPaletteEntries As PALETTEENTRY) As Integer
  22.     Declare Function RealizePalette Lib "User" (ByVal hdc As Integer) As Integer
  23. #End If
  24.